﻿@using Webdiyer.WebControls.Mvc
@model Webdiyer.WebControls.Mvc.PagedList<WorkTimePrj.Models.Project>
           
<!DOCTYPE html>

<html>
<head>
   <title>项目管理</title>
    <link href="@Url.Content("~/Content/css/Basic.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/usecss.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/mgmt.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
	<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/ClearFloat.css")" rel="stylesheet" type="text/css" />
	<script src="@Url.Content("~/Scripts/jquery-all.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/common.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    <style type="text/css">
        .WP_1{margin: 15px 10px;}
        .Select{font-family:simsun;}
        input[type='text'].TB01{width:153px;font-family:simsun;}
        div#layout h2{width:115px;float:left;font-size:16px;}
        div#layout span.SP1{float:left;}
        div#layout #btnAdd{float:right;margin-right:15px;}
        input[type='text'], input[type='password']{width:150px;}
        table tr th{font-family:simsun;font-size:15px; font-weight: bold;background-color:#197B30;color:#ffffff;}
        .list th{height:19px;line-height:19px;}
        table tr td.Col1{width:90px;}
        table tr td.Col2{width:215px; text-align:left;}
        table tr td{font-family:simsun;}
        span.cpb{color:#338AA5;}
        .Button01{float:left;margin-right:5px;}
        *:first-child+html .Button01{float:left;margin-right:5px;padding-left:0;padding-right:0;}
        a.Link{display:block;float:left;border:solid 1px #003677;height:11px;line-height:11px;padding:5px;color:#003677;}
    </style>
</head>
<body>
   
    @using (Html.BeginForm())
      { 
    <div id="layout" class="layout">
         <div style="margin: 10px; border-bottom:solid 1px #c2c2c2; padding-bottom:10px;" class="group">
            <h2>项目列表</h2>
            <span class="SP1">总计 @ViewBag.cnt 条记录</span>
            <input id="btnAdd" type="button" value="新建项目" onclick="window.open('@Url.Action("Create")')" class="Button01" />
         </div>
        <table style="width: 100%;">
            <tr>
                <td class="Col1">
                    项目代码
                </td>
                <td class="Col2">
                    <input id="TBCode" name="TBCode" class="TB01" type="text" value="@ViewBag.code.ToString()" />
                </td>
                <td class="Col1">
                    项目名称
                </td>
                <td class="Col2">
                   <input id="TBDisplay" name="TBDisplay" class="TB01" type="text" value="@ViewBag.display.ToString()" />
                </td>
                <td></td>
            </tr>
            <tr>
                <td>
                    项目状态
                </td>
                <td class="Col2">
                    @Html.DropDownList("projstatusSelectList",null, "---",new{@class="Select"})
                </td>
                <td>
                    项目经理
                </td>
                <td class="Col2">
                    @Html.DropDownList("pmSelectList", null, "---", new { @class = "Select" })
                </td>
                <td style="text-align:left;">
                    <input id="Submit2" type="submit" value="查询" class="Button01"/>
                </td>
            </tr>
        </table> 
        <div class="settings" style="padding:10px;">
        <table class="list" cellspacing="0" border="1" style="border-collapse: collapse; border-color: #d1d1d1;">
            <tbody>
                <tr class="listtitle tableline">
                <th width="100px">
                    项目代码
                </th>
                <th width="250px">
                    项目名称
                </th>
                <th width="100px">
                    创建时间
                </th>
                  <th width="135px">
                    项目经理
                </th>
                  <th width="135px">
                    开发经理
                </th>
                <th width="100px">
                    更新时间
                </th>
                <th width="100px">
                    状态
                </th>
                <th width="100px">
                    创建人
                </th>
                <th  width="150px">
                    操作
                </th>
            </tr>
    
            @foreach (var item in Model)
               {
                <tr class="listcontent tableline">
                    <td>
                        @MVCHelpers.Eval(item.code)
                    </td>
                    <td style="text-align:left;">
                        @MVCHelpers.Eval(item.display)
                    </td>
                    <td>
                        @MVCHelpers.Eval(item.createtime, "yyyy-MM-dd", "")
                    </td>
                    <td>
                        @MVCHelpers.Eval(item.PM)
                    </td>
                    <td>
                        @MVCHelpers.Eval(item.SE)
                    </td>
                    <td>
                        @MVCHelpers.Eval(item.updatetime, "yyyy-MM-dd", "")
                    </td>
                    <td>
                        @MVCHelpers.Eval(item.status)
                    </td>
                    <td>
                        @MVCHelpers.Eval(item.creator)
                    </td>
                    <td>
                        <button type="button" onclick="window.open('@Url.Action("Edit", new { id = item.pid })')" class="Button01" style="line-height: 24px; height: 24px;">
                            <span style="margin: 0px; padding: 0px;">编辑</span>
                        </button>
                        <button type="button" onclick="window.open('@Url.Action("Details", new { id = item.pid })')" class="Button01" style="line-height: 24px; height: 24px;">
                            <span style="margin: 0px; padding: 0px;">详细信息</span>
                        </button>
                      
                         @Ajax.ActionLink("删除", "Delete", new { id =item.pid},
         new AjaxOptions
         {
             Confirm = "确认要删除吗？",
             HttpMethod = "Delete",
             OnSuccess = "alert('删除成功！');window.location.reload();",
             OnFailure = "alert('删除失败！');"
         }, new { @class = "Link" })
                    </td>
                </tr>
            } 
            </tbody>
        </table>
        </div>
    </div>
   }
   
    <div style="margin: 20px;">
    @Html.Pager(Model, new Webdiyer.WebControls.Mvc.PagerOptions
{
    PageIndexParameterName = "id",
    CurrentPagerItemWrapperFormatString = "<span class=\"cpb\">{0}</span>",
    NumericPagerItemWrapperFormatString = "<span class=\"item\">{0}</span>"
})
    </div>
    @Html.CommonnScript()
    
</body>
</html>
